import store from '@/store'
// 编辑器自定义事件
const events = {
    redirect(url) {
        store.commit('setPage', url)
    },

    alert(msg) {
        if (msg) {
            alert(msg)
        }
    },

    setCamera(e) {
        __g.camera.set(492133.3125, 2491067.5, 913.379272, -33.511795, 114.072952, 0);
    }
}

const mixins = {
    methods: events,
}

const eventList = [
    {
        key: 'redirect',
        label: '跳转事件',
        event: events.redirect,
        param: 0,
    },
    {
        key: 'alert',
        label: 'alert 事件',
        event: events.alert,
        param: '',
    },
    {
        key: 'setCamera',
        label: '设置相机',
        event: events.setCamera,
        param: '',
    },
]

export {
    mixins,
    events,
    eventList,
}